package com.emperor.mapper;

import com.emperor.dto.UserLoginDto;
import com.emperor.entity.User;

import com.emperor.vo.UserPageVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface UserMapper {
    @Select("select * from tb_user where login_name=#{loginName} and password=#{password}")
    User login(UserLoginDto userLoginDto);

    @Select("select * from tb_user where id=#{id}")
    User getUser(Integer id);

    List<UserPageVO> findAll(String name);

    void save(User user);

    void updateById(Integer userId, User user);

    void deleteById(Integer userId);
}
